/**
 * @Description: jdk5.0之后
 * @author: ten_fei
 * @date: 2021-03-04 20:43
 */
public class SeasonTest2 {
    public static void main(String[] args) {
        Season2 summer = Season2.SUMMER;
        System.out.println(summer);
        System.out.println(Season2.class.getSuperclass());
    }
}


//自定义枚举类
enum Season2 {

    //1.提供当前枚举类的多个对象
    SPRING("春天", "春暖花开"),
    SUMMER("夏天", "夏日炎炎"),
    AUTUMN("秋天", "秋高气爽"),
    WINTER("冬天", "冰天雪地");

    //2.声明Season的私有化对象
    private final String seasonName;
    private final String seasonDesc;

    //3.私有化类构造器
    private Season2(String seasonName, String seasonDesc) {
        this.seasonName = seasonName;
        this.seasonDesc = seasonDesc;
    }


    //4.提供Get方法
    public String getSeasonName() {
        return seasonName;
    }

    public String getSeasonDesc() {
        return seasonDesc;
    }

    //5.提供toString方法

    @Override
    public String toString() {
        return "Season{" +
                "seasonName='" + seasonName + '\'' +
                ", seasonDesc='" + seasonDesc + '\'' +
                '}';
    }
}
